package com.example.mybrowser;

import java.net.Socket;

public class MobileHandler extends Thread
{
	String HTMLurl;
	Socket socket;
	ResourceSocketThread[] resthread;
	String theres;
	public MobileHandler(String HTMLURL, ResourceSocketThread[] resthreadlist)
	{
		HTMLurl = HTMLURL;
		resthread = resthreadlist;
		theres = "";
		theres += "HTTP/1.1 200 OK\n";
		theres += "Date: Mon, 7 Apr 2014 23:59:59 GMT\n";
		theres += "Content-Type: text/html;charset=ISO-8859-1\n";
		theres += "Content-Length: 56\n";
		theres += "\n";
		theres += "<html><body><h1>Hello MobileService!</h1></body></html>\0\n";
	}
	@Override
	public void run()
	{
		/*try
		{
			Thread.sleep(10000000);
		}
		catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		int i;
		for (i=0;i<5;i++)
		{
			if (resthread[i]!=null)
			{
				resthread[i].WriteResource(theres);
				synchronized (resthread[i].threadlock) 
		        { 
		           try
		           {
		        	   resthread[i].threadlock.notify(); 
		           }catch(Exception e){
		        	   e.printStackTrace();
		           }
		        }
				
			}
		}*/
	}
}
